package automation.readxmlFile;



import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.jdom2.Element;

import sms.automation.common.Constant;
import until.Reporter;
import until.XMLParser;

public class readFileConfig { 
	public static String testuserrole;

	public static XMLParser testconfig;
	public static XMLParser testprofileSaadmin;
	public static XMLParser testprofileAdmin;
	public  static XMLParser testprofileTherapist;
	public  static XMLParser testprofilePatient;
	public  static XMLParser newfuntion;

	
	public static Reporter reporter;
	public static boolean istarted=false;
	public String username;
	public String pass;
	
	
	public readFileConfig(Element node){
		//username=node.getAttributeValue("username");
		username=node.getAttribute("username").getValue();
		pass=node.getAttribute("pass").getValue();
		
		
	}
	
	static public void InitTest(){

		  
		    testconfig=new XMLParser("Config\\configTesting.xml");

		
		
			testprofileSaadmin=new XMLParser("Config\\systemadmin.xml");
		
		
		
			testprofileAdmin=new XMLParser("Config\\Admin.xml");
		
	
			testprofileTherapist=new XMLParser("Config\\Therapist.xml");
		
		
			testprofilePatient=new XMLParser("Config\\Patient.xml");
		
	
		     newfuntion=new XMLParser("Config\\newfuntion.xml");
		  
		System.out.println("======================= Done!");

	
		DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		Date date=new Date();
		String strdate=dateFormat.format(date).toString();
		String reportFilePath = Constant.REPORT_PATH +"HealthCareAutomation"+strdate+".html" ;
		reporter = new Reporter(reportFilePath);
		reporter.initLogFile();
		System.out.println("======================= Initial log file => OK!");

		System.out.println("======================= Starting test...");

		System.out.println();
		System.out.println("======================= Test process:");
		System.out.println();

		istarted = true;
	} 
}
